/**
 * 创建对象,并初始化
 */
function Setting(ele, option) {
	this.initPlus()
	this.initData()
	this.initEvent();
}

Setting.prototype.initPlus = function() {
	$initPlus(function(web) {
		plus.runtime.getProperty( plus.runtime.appid, function(wigInfo){
			var version = document.getElementById('version')
			version.innerText = 'V'+wigInfo.version;
			version.setAttribute('data-appid',wigInfo.appid)
		});
	})
}
Setting.prototype.initData = function() {

}
Setting.prototype.initEvent = function() {
	//通知
	$click("sysNotify", function() {
		// $plusStartSetting("notify")
		// $plusNotification()
	});
	//隐私设置
	$click("selfSetting", function() {
		$openWindow(this, 'data-page')
	})
	
	// 退出登录 luzhiqiang
	$click("loginOut", function() {
		plus.nativeUI.showWaiting('正在清除用户信息', {
			modal: true
		})
		setTimeout(function() {
			plus.nativeUI.closeWaiting()
			var state = {};
			app.setState(state);
			localStorage.setItem('$user', JSON.stringify(state));
			plus.runtime.restart(); //重新启动
		}, 800);
	})
}
//创建实例
new Setting()
